
import DefaultCanvas from "./DefaultCanvas"
import ICanvas from "./ICanvas"
import MessageManager from "./MessageManager"
import ObjContainer from "./ObjContainer"
import Player from "./Player"
import WebSocketClient from "./WebSocketClient"
import RenderFrameDetails from "./canvas_hooks/default_canvas_hooks/RenderFramesDetails"
import BaseHome from "./obj/BaseHome"
import ImageObj from "./obj/ImageObj"
import PandaHeader from "./obj/PandaHeader"
import Circle from "./shapes/Circle"


function main() {

    let canvas: ICanvas = new DefaultCanvas("canvas");
    let hooks = (<DefaultCanvas>canvas).hooks
    hooks.addHook(new RenderFrameDetails())
    canvas.draw()//canvas启动

    let client: WebSocketClient = new WebSocketClient("ws://127.0.0.1:8090")
    client.start()//启动websocket
    MessageManager.socketClient = client
    // let image = new ImageObj("/resources/images/test.jpg")
    // image.onload((ev) => {
    //     image.width = 30
    //     image.height = 40
    // })

    // ObjContainer.addObj(image)
 

    ObjContainer.addObj(new BaseHome(300,300))

}


main()